//package com.bosssoft.cloud.wechat.infrastructure.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.cors.CorsConfiguration;
//import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
//import org.springframework.web.filter.CorsFilter;
//
//import java.util.Arrays;
//
///**
// * 跨域配置（大概率删掉不用）
// *
// * @author wcy create on 2021/7/23 18:22 下午
// */
//@Configuration
//public class CorsConfig {
//    private CorsConfiguration buildConfig() {
//        CorsConfiguration corsConfiguration = new CorsConfiguration();
//        corsConfiguration.setAllowedHeaders(
//                Arrays.asList("Content-Type", "Access-Control-Allow-Headers", "Authorization", "X-Requested-With")
//        );
//        corsConfiguration.setAllowedMethods(
//                Arrays.asList("POST", "GET", "OPTIONS", "DELETE", "PUT")
//        );
//        return corsConfiguration;
//    }
//
//    @Bean
//    public CorsFilter corsFilter() {
//        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
//        source.registerCorsConfiguration("/**", buildConfig());
//        return new CorsFilter(source);
//    }
//}
